Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON logging support #3305

Merged
merged 9 commits into from
Nov 19, 2023
Merged

Conversation

nullishamy
Copy link
Contributor

This is a re-open of #3303, which got closed for some reason (not sure if the UI bugged, if I misclicked, or something else)

This adds support for JSON logging, along with the relevant options required.

This does not change the default log behaviour, so should be backwards compatible.

It is opt in via the {STREAM,FILE}_LOG_FORMAT option, which can be 'json' to use the new logger, or anything else to fallback to the old behaviour.

This is implemented in terms of a custom formatter, which is optionally applied to the log streams.

Closes #3246

nullishamy and others added 8 commits September 6, 2023 19:28
This adds support for JSON logging, along with the relevant options required.

This does not change the default log behaviour, so should be backwards compatible.

It is opt in via the LOG_FORMAT option, which can be 'json' to use the new logger, or anything else to fallback
to the old behaviour.

This is implemented in terms of a custom formatter, which is optionally applied to the stdout stream.
The debug stream is unaffected by this.
@nullishamy nullishamy changed the base branch from master to development September 14, 2023 17:57
@nullishamy nullishamy closed this Oct 7, 2023
@nullishamy nullishamy deleted the feat/json-logging branch October 7, 2023 07:48
@nullishamy nullishamy restored the feat/json-logging branch October 25, 2023 19:30
@nullishamy
Copy link
Contributor Author

I actually don't know what the hell is going on here. I'm not closing these willfully. Going to report to GitHub if this happens again??

@nullishamy nullishamy reopened this Oct 25, 2023
@nullishamy nullishamy closed this Oct 27, 2023
@nullishamy nullishamy deleted the feat/json-logging branch October 27, 2023 18:15
@nullishamy nullishamy restored the feat/json-logging branch October 27, 2023 18:58
@nullishamy
Copy link
Contributor Author

Reporting this.

@nullishamy nullishamy reopened this Oct 27, 2023
Copy link
Collaborator

@Taaku18 Taaku18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the commits, looks good!

@Taaku18 Taaku18 merged commit 6d61cf2 into modmail-dev:development Nov 19, 2023
2 checks passed
@Taaku18 Taaku18 added approved staged Staged for next version and removed approved labels Nov 19, 2023
@Taaku18 Taaku18 mentioned this pull request Nov 20, 2023
@nullishamy nullishamy deleted the feat/json-logging branch December 16, 2023 20:31
raidensakura pushed a commit to raidensakura/modmail that referenced this pull request Apr 10, 2024
* Add JSON logging support

This adds support for JSON logging, along with the relevant options required.

This does not change the default log behaviour, so should be backwards compatible.

It is opt in via the LOG_FORMAT option, which can be 'json' to use the new logger, or anything else to fallback
to the old behaviour.

This is implemented in terms of a custom formatter, which is optionally applied to the stdout stream.
The debug stream is unaffected by this.

* Allow JSON to be selected when creating handlers

* Allow different formats to be selected for streams/files

* Remove old / unused code

* Add new config opts to helpfile

* Formatting, basic typing and reorder for consistency in project.

---------

Co-authored-by: Jerrie-Aries <[email protected]>
Co-authored-by: Taku <[email protected]>
raidensakura added a commit to raidensakura/modmail that referenced this pull request Apr 21, 2024
raidensakura added a commit to raidensakura/modmail that referenced this pull request Apr 21, 2024
khakers pushed a commit to khakers/OpenModmail that referenced this pull request Jun 18, 2024
* Add JSON logging support

This adds support for JSON logging, along with the relevant options required.

This does not change the default log behaviour, so should be backwards compatible.

It is opt in via the LOG_FORMAT option, which can be 'json' to use the new logger, or anything else to fallback
to the old behaviour.

This is implemented in terms of a custom formatter, which is optionally applied to the stdout stream.
The debug stream is unaffected by this.

* Allow JSON to be selected when creating handlers

* Allow different formats to be selected for streams/files

* Remove old / unused code

* Add new config opts to helpfile

* Formatting, basic typing and reorder for consistency in project.

---------

Co-authored-by: Jerrie-Aries <[email protected]>
Co-authored-by: Taku <[email protected]>

(cherry picked from commit 6d61cf2)
Signed-off-by: Khakers <[email protected]>
khakers pushed a commit to khakers/OpenModmail that referenced this pull request Jun 18, 2024
* Add JSON logging support

This adds support for JSON logging, along with the relevant options required.

This does not change the default log behaviour, so should be backwards compatible.

It is opt in via the LOG_FORMAT option, which can be 'json' to use the new logger, or anything else to fallback
to the old behaviour.

This is implemented in terms of a custom formatter, which is optionally applied to the stdout stream.
The debug stream is unaffected by this.

* Allow JSON to be selected when creating handlers

* Allow different formats to be selected for streams/files

* Remove old / unused code

* Add new config opts to helpfile

* Formatting, basic typing and reorder for consistency in project.

---------

Co-authored-by: Jerrie-Aries <[email protected]>
Co-authored-by: Taku <[email protected]>

(cherry picked from commit 6d61cf2)
Signed-off-by: Khakers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staged Staged for next version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON format log output
3 participants